| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 EXTENSIONS_RENDERER_SCRIPT_CONTEXT_H_ | 5 #ifndef EXTENSIONS_RENDERER_SCRIPT_CONTEXT_H_ |
| 6 #define EXTENSIONS_RENDERER_SCRIPT_CONTEXT_H_ | 6 #define EXTENSIONS_RENDERER_SCRIPT_CONTEXT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 static GURL GetDataSourceURLForFrame(const blink::WebFrame* frame); | 126 static GURL GetDataSourceURLForFrame(const blink::WebFrame* frame); |
| 127 | 127 |
| 128 // Returns the first non-about:-URL in the document hierarchy above and | 128 // Returns the first non-about:-URL in the document hierarchy above and |
| 129 // including |frame|. The document hierarchy is only traversed if | 129 // including |frame|. The document hierarchy is only traversed if |
| 130 // |document_url| is an about:-URL and if |match_about_blank| is true. | 130 // |document_url| is an about:-URL and if |match_about_blank| is true. |
| 131 static GURL GetEffectiveDocumentURL(const blink::WebFrame* frame, | 131 static GURL GetEffectiveDocumentURL(const blink::WebFrame* frame, |
| 132 const GURL& document_url, | 132 const GURL& document_url, |
| 133 bool match_about_blank); | 133 bool match_about_blank); |
| 134 | 134 |
| 135 // RequestSender::Source implementation. | 135 // RequestSender::Source implementation. |
| 136 virtual ScriptContext* GetContext() OVERRIDE; | 136 virtual ScriptContext* GetContext() override; |
| 137 virtual void OnResponseReceived(const std::string& name, | 137 virtual void OnResponseReceived(const std::string& name, |
| 138 int request_id, | 138 int request_id, |
| 139 bool success, | 139 bool success, |
| 140 const base::ListValue& response, | 140 const base::ListValue& response, |
| 141 const std::string& error) OVERRIDE; | 141 const std::string& error) override; |
| 142 | 142 |
| 143 // gin::Runner overrides. | 143 // gin::Runner overrides. |
| 144 virtual void Run(const std::string& source, | 144 virtual void Run(const std::string& source, |
| 145 const std::string& resource_name) OVERRIDE; | 145 const std::string& resource_name) override; |
| 146 virtual v8::Handle<v8::Value> Call(v8::Handle<v8::Function> function, | 146 virtual v8::Handle<v8::Value> Call(v8::Handle<v8::Function> function, |
| 147 v8::Handle<v8::Value> receiver, | 147 v8::Handle<v8::Value> receiver, |
| 148 int argc, | 148 int argc, |
| 149 v8::Handle<v8::Value> argv[]) OVERRIDE; | 149 v8::Handle<v8::Value> argv[]) override; |
| 150 virtual gin::ContextHolder* GetContextHolder() OVERRIDE; | 150 virtual gin::ContextHolder* GetContextHolder() override; |
| 151 | 151 |
| 152 protected: | 152 protected: |
| 153 // The v8 context the bindings are accessible to. | 153 // The v8 context the bindings are accessible to. |
| 154 ScopedPersistent<v8::Context> v8_context_; | 154 ScopedPersistent<v8::Context> v8_context_; |
| 155 | 155 |
| 156 private: | 156 private: |
| 157 // The WebFrame associated with this context. This can be NULL because this | 157 // The WebFrame associated with this context. This can be NULL because this |
| 158 // object can outlive is destroyed asynchronously. | 158 // object can outlive is destroyed asynchronously. |
| 159 blink::WebFrame* web_frame_; | 159 blink::WebFrame* web_frame_; |
| 160 | 160 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 180 SafeBuiltins safe_builtins_; | 180 SafeBuiltins safe_builtins_; |
| 181 | 181 |
| 182 v8::Isolate* isolate_; | 182 v8::Isolate* isolate_; |
| 183 | 183 |
| 184 DISALLOW_COPY_AND_ASSIGN(ScriptContext); | 184 DISALLOW_COPY_AND_ASSIGN(ScriptContext); |
| 185 }; | 185 }; |
| 186 | 186 |
| 187 } // namespace extensions | 187 } // namespace extensions |
| 188 | 188 |
| 189 #endif // EXTENSIONS_RENDERER_SCRIPT_CONTEXT_H_ | 189 #endif // EXTENSIONS_RENDERER_SCRIPT_CONTEXT_H_ |
| OLD | NEW |