| 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 <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 // Similar to GetDataSourceURLForFrame, but only returns the data source URL | 170 // Similar to GetDataSourceURLForFrame, but only returns the data source URL |
| 171 // if the frame's document url is empty and the frame has a security origin | 171 // if the frame's document url is empty and the frame has a security origin |
| 172 // that allows access to the data source url. | 172 // that allows access to the data source url. |
| 173 // TODO(asargent/devlin) - there may be places that should switch to using | 173 // TODO(asargent/devlin) - there may be places that should switch to using |
| 174 // this instead of GetDataSourceURLForFrame. | 174 // this instead of GetDataSourceURLForFrame. |
| 175 static GURL GetAccessCheckedFrameURL(const blink::WebLocalFrame* frame); | 175 static GURL GetAccessCheckedFrameURL(const blink::WebLocalFrame* frame); |
| 176 | 176 |
| 177 // Returns the first non-about:-URL in the document hierarchy above and | 177 // Returns the first non-about:-URL in the document hierarchy above and |
| 178 // including |frame|. The document hierarchy is only traversed if | 178 // including |frame|. The document hierarchy is only traversed if |
| 179 // |document_url| is an about:-URL and if |match_about_blank| is true. | 179 // |document_url| is an about:-URL and if |match_about_blank| is true. |
| 180 static GURL GetEffectiveDocumentURL(const blink::WebLocalFrame* frame, | 180 static GURL GetEffectiveDocumentURL(blink::WebLocalFrame* frame, |
| 181 const GURL& document_url, | 181 const GURL& document_url, |
| 182 bool match_about_blank); | 182 bool match_about_blank); |
| 183 | 183 |
| 184 // RequestSender::Source implementation. | 184 // RequestSender::Source implementation. |
| 185 ScriptContext* GetContext() override; | 185 ScriptContext* GetContext() override; |
| 186 void OnResponseReceived(const std::string& name, | 186 void OnResponseReceived(const std::string& name, |
| 187 int request_id, | 187 int request_id, |
| 188 bool success, | 188 bool success, |
| 189 const base::ListValue& response, | 189 const base::ListValue& response, |
| 190 const std::string& error) override; | 190 const std::string& error) override; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 std::unique_ptr<Runner> runner_; | 272 std::unique_ptr<Runner> runner_; |
| 273 | 273 |
| 274 base::ThreadChecker thread_checker_; | 274 base::ThreadChecker thread_checker_; |
| 275 | 275 |
| 276 DISALLOW_COPY_AND_ASSIGN(ScriptContext); | 276 DISALLOW_COPY_AND_ASSIGN(ScriptContext); |
| 277 }; | 277 }; |
| 278 | 278 |
| 279 } // namespace extensions | 279 } // namespace extensions |
| 280 | 280 |
| 281 #endif // EXTENSIONS_RENDERER_SCRIPT_CONTEXT_H_ | 281 #endif // EXTENSIONS_RENDERER_SCRIPT_CONTEXT_H_ |
| OLD | NEW |