15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved.
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file.
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#ifndef ANDROID_WEBVIEW_BROWSER_SCOPED_ALLOW_WAIT_FOR_LEGACY_WEB_VIEW_API_H
65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define ANDROID_WEBVIEW_BROWSER_SCOPED_ALLOW_WAIT_FOR_LEGACY_WEB_VIEW_API_H
75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/threading/thread_restrictions.h"
95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// This class is only available when building the chromium back-end for android
115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// webview: it is required where API backward compatibility demands that the UI
125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// thread must block waiting on other threads e.g. to obtain a synchronous
135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// return value. Long term, asynchronous overloads of all such methods will be
145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// added in the public API, and and no new uses of this will be allowed.
155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class ScopedAllowWaitForLegacyWebViewApi {
165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) private:
175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  base::ThreadRestrictions::ScopedAllowWait wait;
185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)};
195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif  // ANDROID_WEBVIEW_BROWSER_SCOPED_ALLOW_WAIT_FOR_LEGACY_WEB_VIEW_API_H
21