Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef ANDROID_WEBVIEW_BROWSER_AW_CONTENTS_IO_THREAD_CLIENT_H_ | 5 #ifndef ANDROID_WEBVIEW_BROWSER_AW_CONTENTS_IO_THREAD_CLIENT_H_ |
| 6 #define ANDROID_WEBVIEW_BROWSER_AW_CONTENTS_IO_THREAD_CLIENT_H_ | 6 #define ANDROID_WEBVIEW_BROWSER_AW_CONTENTS_IO_THREAD_CLIENT_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 | 9 |
| 10 class GURL; | 10 class GURL; |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 36 public: | 36 public: |
| 37 virtual ~AwContentsIoThreadClient() {} | 37 virtual ~AwContentsIoThreadClient() {} |
| 38 | 38 |
| 39 // This will attempt to fetch the AwContentsIoThreadClient for the given | 39 // This will attempt to fetch the AwContentsIoThreadClient for the given |
| 40 // |render_process_id|, |render_view_id| pair. | 40 // |render_process_id|, |render_view_id| pair. |
| 41 // This method can be called from any thread. | 41 // This method can be called from any thread. |
| 42 // An empty scoped_ptr is a valid return value. | 42 // An empty scoped_ptr is a valid return value. |
| 43 static scoped_ptr<AwContentsIoThreadClient> FromID(int render_process_id, | 43 static scoped_ptr<AwContentsIoThreadClient> FromID(int render_process_id, |
| 44 int render_view_id); | 44 int render_view_id); |
| 45 | 45 |
| 46 // Notifies registered observers when an AwIoThreadClient is registerd | |
| 47 // for the specified |child_id| and |route_id|. Invoked on the thread | |
| 48 // that the Observer was registered on. | |
| 49 class ReadyObserver { | |
| 50 public: | |
| 51 virtual void OnIoThreadClientReady(int child_id, int route_id) = 0; | |
|
joth
2012/11/16 21:52:57
protected virtual d'tor.
benm (inactive)
2012/11/28 20:00:05
Done.
| |
| 52 }; | |
| 53 | |
| 54 // Add/remove an observer that will be notified as AwIoThreadClients | |
| 55 // are registered. | |
| 56 static void AddReadyObserver(ReadyObserver* obs); | |
| 57 static void RemoveReadyObserver(ReadyObserver* obs); | |
|
joth
2012/11/16 21:52:57
document which thread these must be called on, and
benm (inactive)
2012/11/28 20:00:05
Would do, but I think I'm going to go with your su
| |
| 58 | |
| 46 // This method is called on the IO thread only. | 59 // This method is called on the IO thread only. |
| 47 virtual scoped_ptr<InterceptedRequestData> ShouldInterceptRequest( | 60 virtual scoped_ptr<InterceptedRequestData> ShouldInterceptRequest( |
| 48 const GURL& location, | 61 const GURL& location, |
| 49 const net::URLRequest* request) = 0; | 62 const net::URLRequest* request) = 0; |
| 50 | 63 |
| 51 // Retrieve the AllowContentAccess setting value of this AwContents. | 64 // Retrieve the AllowContentAccess setting value of this AwContents. |
| 52 // This method is called on the IO thread only. | 65 // This method is called on the IO thread only. |
| 53 virtual bool ShouldBlockContentUrls() const = 0; | 66 virtual bool ShouldBlockContentUrls() const = 0; |
| 54 | 67 |
| 55 // Retrieve the AllowFileAccess setting value of this AwContents. | 68 // Retrieve the AllowFileAccess setting value of this AwContents. |
| 56 // This method is called on the IO thread only. | 69 // This method is called on the IO thread only. |
| 57 virtual bool ShouldBlockFileUrls() const = 0; | 70 virtual bool ShouldBlockFileUrls() const = 0; |
| 58 | 71 |
| 59 // Retrieve the BlockNetworkLoads setting value of this AwContents. | 72 // Retrieve the BlockNetworkLoads setting value of this AwContents. |
| 60 // This method is called on the IO thread only. | 73 // This method is called on the IO thread only. |
| 61 virtual bool ShouldBlockNetworkLoads() const = 0; | 74 virtual bool ShouldBlockNetworkLoads() const = 0; |
| 62 }; | 75 }; |
| 63 | 76 |
| 64 } // namespace android_webview | 77 } // namespace android_webview |
| 65 | 78 |
| 66 #endif // ANDROID_WEBVIEW_BROWSER_AW_CONTENTS_IO_THREAD_CLIENT_H_ | 79 #endif // ANDROID_WEBVIEW_BROWSER_AW_CONTENTS_IO_THREAD_CLIENT_H_ |
| OLD | NEW |