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

Side by Side Diff: mojo/examples/png_viewer/png_viewer.cc

Issue 638293005: ContentHandler::OnConnect: replace the |url| param with |requestor_url|. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months 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 #include <algorithm> 5 #include <algorithm>
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/string_tokenizer.h" 10 #include "base/strings/string_tokenizer.h"
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 }; 194 };
195 195
196 class ContentHandlerImpl : public InterfaceImpl<ContentHandler> { 196 class ContentHandlerImpl : public InterfaceImpl<ContentHandler> {
197 public: 197 public:
198 explicit ContentHandlerImpl(Shell* shell) : shell_(shell) {} 198 explicit ContentHandlerImpl(Shell* shell) : shell_(shell) {}
199 virtual ~ContentHandlerImpl() {} 199 virtual ~ContentHandlerImpl() {}
200 200
201 private: 201 private:
202 // Overridden from ContentHandler: 202 // Overridden from ContentHandler:
203 virtual void OnConnect( 203 virtual void OnConnect(
204 const mojo::String& url, 204 const mojo::String& requestor_url,
205 URLResponsePtr response, 205 URLResponsePtr response,
206 InterfaceRequest<ServiceProvider> service_provider) override { 206 InterfaceRequest<ServiceProvider> service_provider) override {
207 ServiceProviderImpl* exported_services = new ServiceProviderImpl(); 207 ServiceProviderImpl* exported_services = new ServiceProviderImpl();
208 BindToRequest(exported_services, &service_provider); 208 BindToRequest(exported_services, &service_provider);
209 scoped_ptr<ServiceProvider> remote( 209 scoped_ptr<ServiceProvider> remote(
210 exported_services->CreateRemoteServiceProvider()); 210 exported_services->CreateRemoteServiceProvider());
211 PNGView::Spawn(response.Pass(), exported_services, remote.Pass(), shell_); 211 PNGView::Spawn(response.Pass(), exported_services, remote.Pass(), shell_);
212 } 212 }
213 213
214 Shell* shell_; 214 Shell* shell_;
(...skipping 25 matching lines...) Expand all
240 DISALLOW_COPY_AND_ASSIGN(PNGViewer); 240 DISALLOW_COPY_AND_ASSIGN(PNGViewer);
241 }; 241 };
242 242
243 } // namespace examples 243 } // namespace examples
244 } // namespace mojo 244 } // namespace mojo
245 245
246 MojoResult MojoMain(MojoHandle shell_handle) { 246 MojoResult MojoMain(MojoHandle shell_handle) {
247 mojo::ApplicationRunnerChromium runner(new mojo::examples::PNGViewer); 247 mojo::ApplicationRunnerChromium runner(new mojo::examples::PNGViewer);
248 return runner.Run(shell_handle); 248 return runner.Run(shell_handle);
249 } 249 }
OLDNEW
« no previous file with comments | « mojo/examples/content_handler_demo/content_handler_demo.cc ('k') | mojo/services/html_viewer/html_viewer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698