Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(401)

Side by Side Diff: content/renderer/web_ui_mojo_context_state.h

Issue 1457623004: Serve mojo WebUI resources from the same origin as the WebUI itself. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 CONTENT_RENDERER_WEB_UI_MOJO_CONTEXT_STATE_H_ 5 #ifndef CONTENT_RENDERER_WEB_UI_MOJO_CONTEXT_STATE_H_
6 #define CONTENT_RENDERER_WEB_UI_MOJO_CONTEXT_STATE_H_ 6 #define CONTENT_RENDERER_WEB_UI_MOJO_CONTEXT_STATE_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 // Callback once a module has finished downloading. Passes data to |runner_|. 55 // Callback once a module has finished downloading. Passes data to |runner_|.
56 void OnFetchModuleComplete(ResourceFetcher* fetcher, 56 void OnFetchModuleComplete(ResourceFetcher* fetcher,
57 const blink::WebURLResponse& response, 57 const blink::WebURLResponse& response,
58 const std::string& data); 58 const std::string& data);
59 59
60 // gin::ModuleRegistryObserver overrides: 60 // gin::ModuleRegistryObserver overrides:
61 void OnDidAddPendingModule( 61 void OnDidAddPendingModule(
62 const std::string& id, 62 const std::string& id,
63 const std::vector<std::string>& dependencies) override; 63 const std::vector<std::string>& dependencies) override;
64 64
65 // Returns the prefix to use for all module requests.
66 const std::string& GetModulePrefix();
67
65 // Frame script is executed in. Also used to download resources. 68 // Frame script is executed in. Also used to download resources.
66 blink::WebFrame* frame_; 69 blink::WebFrame* frame_;
67 70
68 // See description above getter. 71 // See description above getter.
69 bool module_added_; 72 bool module_added_;
70 73
71 // Executes the script from gin. 74 // Executes the script from gin.
72 scoped_ptr<WebUIRunner> runner_; 75 scoped_ptr<WebUIRunner> runner_;
73 76
74 // Set of fetchers we're waiting on to download script. 77 // Set of fetchers we're waiting on to download script.
75 ScopedVector<ResourceFetcher> module_fetchers_; 78 ScopedVector<ResourceFetcher> module_fetchers_;
76 79
77 // Set of modules we've fetched script from. 80 // Set of modules we've fetched script from.
78 std::set<std::string> fetched_modules_; 81 std::set<std::string> fetched_modules_;
79 82
83 // A cached copy of the prefix to use for all module requests.
84 std::string module_prefix_;
85
80 DISALLOW_COPY_AND_ASSIGN(WebUIMojoContextState); 86 DISALLOW_COPY_AND_ASSIGN(WebUIMojoContextState);
81 }; 87 };
82 88
83 } // namespace content 89 } // namespace content
84 90
85 #endif // CONTENT_RENDERER_WEB_UI_MOJO_CONTEXT_STATE_H_ 91 #endif // CONTENT_RENDERER_WEB_UI_MOJO_CONTEXT_STATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698