Commit 3f2fc908 authored by davemoore's avatar davemoore Committed by Commit bot

Rename OnServiceError to OnApplicationError

BUG=

Review URL: https://codereview.chromium.org/506103002

Cr-Commit-Position: refs/heads/master@{#291951}
parent 0a2bace1
...@@ -75,8 +75,9 @@ class MOJO_APPLICATION_MANAGER_EXPORT ApplicationLoader { ...@@ -75,8 +75,9 @@ class MOJO_APPLICATION_MANAGER_EXPORT ApplicationLoader {
const GURL& url, const GURL& url,
scoped_refptr<LoadCallbacks> callbacks) = 0; scoped_refptr<LoadCallbacks> callbacks) = 0;
// TODO(davemoore): Change name to OnApplicationError. // Called when the Application exits.
virtual void OnServiceError(ApplicationManager* manager, const GURL& url) = 0; virtual void OnApplicationError(ApplicationManager* manager,
const GURL& url) = 0;
protected: protected:
ApplicationLoader() {} ApplicationLoader() {}
......
...@@ -288,7 +288,7 @@ void ApplicationManager::OnShellImplError(ShellImpl* shell_impl) { ...@@ -288,7 +288,7 @@ void ApplicationManager::OnShellImplError(ShellImpl* shell_impl) {
url_to_shell_impl_.erase(it); url_to_shell_impl_.erase(it);
ApplicationLoader* loader = GetLoaderForURL(url); ApplicationLoader* loader = GetLoaderForURL(url);
if (loader) if (loader)
loader->OnServiceError(this, url); loader->OnApplicationError(this, url);
if (delegate_) if (delegate_)
delegate_->OnApplicationError(url); delegate_->OnApplicationError(url);
} }
......
...@@ -118,8 +118,8 @@ class TestApplicationLoader : public ApplicationLoader, ...@@ -118,8 +118,8 @@ class TestApplicationLoader : public ApplicationLoader,
new ApplicationImpl(this, callbacks->RegisterApplication().Pass())); new ApplicationImpl(this, callbacks->RegisterApplication().Pass()));
} }
virtual void OnServiceError(ApplicationManager* manager, virtual void OnApplicationError(ApplicationManager* manager,
const GURL& url) OVERRIDE {} const GURL& url) OVERRIDE {}
// ApplicationDelegate implementation. // ApplicationDelegate implementation.
virtual bool ConfigureIncomingConnection( virtual bool ConfigureIncomingConnection(
...@@ -329,8 +329,8 @@ class Tester : public ApplicationDelegate, ...@@ -329,8 +329,8 @@ class Tester : public ApplicationDelegate,
new ApplicationImpl(this, callbacks->RegisterApplication().Pass())); new ApplicationImpl(this, callbacks->RegisterApplication().Pass()));
} }
virtual void OnServiceError(ApplicationManager* manager, virtual void OnApplicationError(ApplicationManager* manager,
const GURL& url) OVERRIDE {} const GURL& url) OVERRIDE {}
virtual bool ConfigureIncomingConnection( virtual bool ConfigureIncomingConnection(
ApplicationConnection* connection) OVERRIDE { ApplicationConnection* connection) OVERRIDE {
......
...@@ -23,8 +23,8 @@ class BackgroundShellApplicationLoader::BackgroundLoader { ...@@ -23,8 +23,8 @@ class BackgroundShellApplicationLoader::BackgroundLoader {
loader_->Load(manager, url, callbacks); loader_->Load(manager, url, callbacks);
} }
void OnServiceError(ApplicationManager* manager, const GURL& url) { void OnApplicationError(ApplicationManager* manager, const GURL& url) {
loader_->OnServiceError(manager, url); loader_->OnApplicationError(manager, url);
} }
private: private:
...@@ -80,16 +80,15 @@ void BackgroundShellApplicationLoader::Load( ...@@ -80,16 +80,15 @@ void BackgroundShellApplicationLoader::Load(
base::Owned(new ScopedMessagePipeHandle(shell_handle.Pass())))); base::Owned(new ScopedMessagePipeHandle(shell_handle.Pass()))));
} }
void BackgroundShellApplicationLoader::OnServiceError( void BackgroundShellApplicationLoader::OnApplicationError(
ApplicationManager* manager, ApplicationManager* manager,
const GURL& url) { const GURL& url) {
task_runner_->PostTask( task_runner_->PostTask(FROM_HERE,
FROM_HERE, base::Bind(&BackgroundShellApplicationLoader::
base::Bind( OnApplicationErrorOnBackgroundThread,
&BackgroundShellApplicationLoader::OnServiceErrorOnBackgroundThread, base::Unretained(this),
base::Unretained(this), manager,
manager, url));
url));
} }
void BackgroundShellApplicationLoader::Run() { void BackgroundShellApplicationLoader::Run() {
...@@ -116,13 +115,13 @@ void BackgroundShellApplicationLoader::LoadOnBackgroundThread( ...@@ -116,13 +115,13 @@ void BackgroundShellApplicationLoader::LoadOnBackgroundThread(
background_loader_->Load(manager, url, shell_handle->Pass()); background_loader_->Load(manager, url, shell_handle->Pass());
} }
void BackgroundShellApplicationLoader::OnServiceErrorOnBackgroundThread( void BackgroundShellApplicationLoader::OnApplicationErrorOnBackgroundThread(
ApplicationManager* manager, ApplicationManager* manager,
const GURL& url) { const GURL& url) {
DCHECK(task_runner_->RunsTasksOnCurrentThread()); DCHECK(task_runner_->RunsTasksOnCurrentThread());
if (!background_loader_) if (!background_loader_)
background_loader_ = new BackgroundLoader(loader_.get()); background_loader_ = new BackgroundLoader(loader_.get());
background_loader_->OnServiceError(manager, url); background_loader_->OnApplicationError(manager, url);
} }
} // namespace mojo } // namespace mojo
...@@ -29,8 +29,8 @@ class MOJO_APPLICATION_MANAGER_EXPORT BackgroundShellApplicationLoader ...@@ -29,8 +29,8 @@ class MOJO_APPLICATION_MANAGER_EXPORT BackgroundShellApplicationLoader
virtual void Load(ApplicationManager* manager, virtual void Load(ApplicationManager* manager,
const GURL& url, const GURL& url,
scoped_refptr<LoadCallbacks> callbacks) OVERRIDE; scoped_refptr<LoadCallbacks> callbacks) OVERRIDE;
virtual void OnServiceError(ApplicationManager* manager, virtual void OnApplicationError(ApplicationManager* manager,
const GURL& url) OVERRIDE; const GURL& url) OVERRIDE;
private: private:
class BackgroundLoader; class BackgroundLoader;
...@@ -45,8 +45,8 @@ class MOJO_APPLICATION_MANAGER_EXPORT BackgroundShellApplicationLoader ...@@ -45,8 +45,8 @@ class MOJO_APPLICATION_MANAGER_EXPORT BackgroundShellApplicationLoader
void LoadOnBackgroundThread(ApplicationManager* manager, void LoadOnBackgroundThread(ApplicationManager* manager,
const GURL& url, const GURL& url,
ScopedMessagePipeHandle* shell_handle); ScopedMessagePipeHandle* shell_handle);
void OnServiceErrorOnBackgroundThread(ApplicationManager* manager, void OnApplicationErrorOnBackgroundThread(ApplicationManager* manager,
const GURL& url); const GURL& url);
bool quit_on_shutdown_; bool quit_on_shutdown_;
scoped_ptr<ApplicationLoader> loader_; scoped_ptr<ApplicationLoader> loader_;
......
...@@ -23,8 +23,8 @@ class DummyLoader : public ApplicationLoader { ...@@ -23,8 +23,8 @@ class DummyLoader : public ApplicationLoader {
base::MessageLoop::current()->Quit(); base::MessageLoop::current()->Quit();
} }
virtual void OnServiceError(ApplicationManager* manager, virtual void OnApplicationError(ApplicationManager* manager,
const GURL& url) OVERRIDE {} const GURL& url) OVERRIDE {}
void DontSimulateAppQuit() { simulate_app_quit_ = false; } void DontSimulateAppQuit() { simulate_app_quit_ = false; }
......
...@@ -64,8 +64,8 @@ class ConnectApplicationLoader : public ApplicationLoader, ...@@ -64,8 +64,8 @@ class ConnectApplicationLoader : public ApplicationLoader,
apps_.push_back(app.release()); apps_.push_back(app.release());
} }
virtual void OnServiceError(ApplicationManager* manager, virtual void OnApplicationError(ApplicationManager* manager,
const GURL& url) OVERRIDE {} const GURL& url) OVERRIDE {}
virtual bool ConfigureIncomingConnection(ApplicationConnection* connection) virtual bool ConfigureIncomingConnection(ApplicationConnection* connection)
OVERRIDE { OVERRIDE {
......
...@@ -360,8 +360,8 @@ class EmbedApplicationLoader : public ApplicationLoader, ...@@ -360,8 +360,8 @@ class EmbedApplicationLoader : public ApplicationLoader,
shell_handle.Pass())); shell_handle.Pass()));
apps_.push_back(app.release()); apps_.push_back(app.release());
} }
virtual void OnServiceError(ApplicationManager* manager, virtual void OnApplicationError(ApplicationManager* manager,
const GURL& url) OVERRIDE {} const GURL& url) OVERRIDE {}
// ApplicationDelegate implementation: // ApplicationDelegate implementation:
virtual bool ConfigureIncomingConnection(ApplicationConnection* connection) virtual bool ConfigureIncomingConnection(ApplicationConnection* connection)
......
...@@ -115,8 +115,8 @@ class TestApplicationLoader : public ApplicationLoader, ...@@ -115,8 +115,8 @@ class TestApplicationLoader : public ApplicationLoader,
new ApplicationImpl(this, shell_handle.Pass())); new ApplicationImpl(this, shell_handle.Pass()));
apps_.push_back(app.release()); apps_.push_back(app.release());
} }
virtual void OnServiceError(ApplicationManager* application_manager, virtual void OnApplicationError(ApplicationManager* application_manager,
const GURL& url) MOJO_OVERRIDE {} const GURL& url) MOJO_OVERRIDE {}
// Overridden from ApplicationDelegate: // Overridden from ApplicationDelegate:
virtual bool ConfigureIncomingConnection( virtual bool ConfigureIncomingConnection(
......
...@@ -127,8 +127,8 @@ class Context::NativeViewportApplicationLoader ...@@ -127,8 +127,8 @@ class Context::NativeViewportApplicationLoader
app_.reset(new ApplicationImpl(this, shell_handle.Pass())); app_.reset(new ApplicationImpl(this, shell_handle.Pass()));
} }
virtual void OnServiceError(ApplicationManager* manager, virtual void OnApplicationError(ApplicationManager* manager,
const GURL& url) OVERRIDE {} const GURL& url) OVERRIDE {}
// ApplicationDelegate implementation. // ApplicationDelegate implementation.
virtual bool ConfigureIncomingConnection( virtual bool ConfigureIncomingConnection(
......
...@@ -162,8 +162,8 @@ void DBusApplicationLoader::Load(ApplicationManager* manager, ...@@ -162,8 +162,8 @@ void DBusApplicationLoader::Load(ApplicationManager* manager,
new LoadContext(this, bus_, url, shell_handle.Pass()); new LoadContext(this, bus_, url, shell_handle.Pass());
} }
void DBusApplicationLoader::OnServiceError(ApplicationManager* manager, void DBusApplicationLoader::OnApplicationError(ApplicationManager* manager,
const GURL& url) { const GURL& url) {
// TODO(cmasone): Anything at all in this method here. // TODO(cmasone): Anything at all in this method here.
} }
......
...@@ -64,8 +64,8 @@ class DBusApplicationLoader : public ApplicationLoader { ...@@ -64,8 +64,8 @@ class DBusApplicationLoader : public ApplicationLoader {
const GURL& url, const GURL& url,
scoped_refptr<LoadCallbacks> callbacks) OVERRIDE; scoped_refptr<LoadCallbacks> callbacks) OVERRIDE;
virtual void OnServiceError(ApplicationManager* manager, virtual void OnApplicationError(ApplicationManager* manager,
const GURL& url) OVERRIDE; const GURL& url) OVERRIDE;
private: private:
class LoadContext; class LoadContext;
......
...@@ -167,8 +167,8 @@ void DynamicApplicationLoader::OnRunLibraryComplete( ...@@ -167,8 +167,8 @@ void DynamicApplicationLoader::OnRunLibraryComplete(
} }
} }
void DynamicApplicationLoader::OnServiceError(ApplicationManager* manager, void DynamicApplicationLoader::OnApplicationError(ApplicationManager* manager,
const GURL& url) { const GURL& url) {
// TODO(darin): What should we do about service errors? This implies that // TODO(darin): What should we do about service errors? This implies that
// the app closed its handle to the service manager. Maybe we don't care? // the app closed its handle to the service manager. Maybe we don't care?
} }
......
...@@ -40,8 +40,8 @@ class DynamicApplicationLoader : public ApplicationLoader { ...@@ -40,8 +40,8 @@ class DynamicApplicationLoader : public ApplicationLoader {
virtual void Load(ApplicationManager* manager, virtual void Load(ApplicationManager* manager,
const GURL& url, const GURL& url,
scoped_refptr<LoadCallbacks> callbacks) OVERRIDE; scoped_refptr<LoadCallbacks> callbacks) OVERRIDE;
virtual void OnServiceError(ApplicationManager* manager, virtual void OnApplicationError(ApplicationManager* manager,
const GURL& url) OVERRIDE; const GURL& url) OVERRIDE;
private: private:
typedef std::map<std::string, GURL> MimeTypeToURLMap; typedef std::map<std::string, GURL> MimeTypeToURLMap;
......
...@@ -44,8 +44,8 @@ void NetworkApplicationLoader::Load(ApplicationManager* manager, ...@@ -44,8 +44,8 @@ void NetworkApplicationLoader::Load(ApplicationManager* manager,
} }
} }
void NetworkApplicationLoader::OnServiceError(ApplicationManager* manager, void NetworkApplicationLoader::OnApplicationError(ApplicationManager* manager,
const GURL& url) { const GURL& url) {
apps_.erase(reinterpret_cast<uintptr_t>(manager)); apps_.erase(reinterpret_cast<uintptr_t>(manager));
} }
......
...@@ -34,8 +34,8 @@ class NetworkApplicationLoader : public ApplicationLoader, ...@@ -34,8 +34,8 @@ class NetworkApplicationLoader : public ApplicationLoader,
virtual void Load(ApplicationManager* manager, virtual void Load(ApplicationManager* manager,
const GURL& url, const GURL& url,
scoped_refptr<LoadCallbacks> callbacks) OVERRIDE; scoped_refptr<LoadCallbacks> callbacks) OVERRIDE;
virtual void OnServiceError(ApplicationManager* manager, virtual void OnApplicationError(ApplicationManager* manager,
const GURL& url) OVERRIDE; const GURL& url) OVERRIDE;
// ApplicationDelegate overrides. // ApplicationDelegate overrides.
virtual void Initialize(ApplicationImpl* app) OVERRIDE; virtual void Initialize(ApplicationImpl* app) OVERRIDE;
......
...@@ -23,8 +23,8 @@ class UIApplicationLoader::UILoader { ...@@ -23,8 +23,8 @@ class UIApplicationLoader::UILoader {
loader_->Load(manager, url, callbacks); loader_->Load(manager, url, callbacks);
} }
void OnServiceError(ApplicationManager* manager, const GURL& url) { void OnApplicationError(ApplicationManager* manager, const GURL& url) {
loader_->OnServiceError(manager, url); loader_->OnApplicationError(manager, url);
} }
private: private:
...@@ -62,11 +62,11 @@ void UIApplicationLoader::Load(ApplicationManager* manager, ...@@ -62,11 +62,11 @@ void UIApplicationLoader::Load(ApplicationManager* manager,
base::Owned(new ScopedMessagePipeHandle(shell_handle.Pass())))); base::Owned(new ScopedMessagePipeHandle(shell_handle.Pass()))));
} }
void UIApplicationLoader::OnServiceError(ApplicationManager* manager, void UIApplicationLoader::OnApplicationError(ApplicationManager* manager,
const GURL& url) { const GURL& url) {
context_->ui_loop()->PostTask( context_->ui_loop()->PostTask(
FROM_HERE, FROM_HERE,
base::Bind(&UIApplicationLoader::OnServiceErrorOnUIThread, base::Bind(&UIApplicationLoader::OnApplicationErrorOnUIThread,
base::Unretained(this), base::Unretained(this),
manager, manager,
url)); url));
...@@ -81,11 +81,12 @@ void UIApplicationLoader::LoadOnUIThread( ...@@ -81,11 +81,12 @@ void UIApplicationLoader::LoadOnUIThread(
ui_loader_->Load(manager, url, shell_handle->Pass()); ui_loader_->Load(manager, url, shell_handle->Pass());
} }
void UIApplicationLoader::OnServiceErrorOnUIThread(ApplicationManager* manager, void UIApplicationLoader::OnApplicationErrorOnUIThread(
const GURL& url) { ApplicationManager* manager,
const GURL& url) {
if (!ui_loader_) if (!ui_loader_)
ui_loader_ = new UILoader(loader_.get()); ui_loader_ = new UILoader(loader_.get());
ui_loader_->OnServiceError(manager, url); ui_loader_->OnApplicationError(manager, url);
} }
void UIApplicationLoader::ShutdownOnUIThread() { void UIApplicationLoader::ShutdownOnUIThread() {
......
...@@ -29,8 +29,8 @@ class UIApplicationLoader : public ApplicationLoader { ...@@ -29,8 +29,8 @@ class UIApplicationLoader : public ApplicationLoader {
virtual void Load(ApplicationManager* manager, virtual void Load(ApplicationManager* manager,
const GURL& url, const GURL& url,
scoped_refptr<LoadCallbacks> callbacks) OVERRIDE; scoped_refptr<LoadCallbacks> callbacks) OVERRIDE;
virtual void OnServiceError(ApplicationManager* manager, virtual void OnApplicationError(ApplicationManager* manager,
const GURL& url) OVERRIDE; const GURL& url) OVERRIDE;
private: private:
class UILoader; class UILoader;
...@@ -42,7 +42,8 @@ class UIApplicationLoader : public ApplicationLoader { ...@@ -42,7 +42,8 @@ class UIApplicationLoader : public ApplicationLoader {
void LoadOnUIThread(ApplicationManager* manager, void LoadOnUIThread(ApplicationManager* manager,
const GURL& url, const GURL& url,
ScopedMessagePipeHandle* shell_handle); ScopedMessagePipeHandle* shell_handle);
void OnServiceErrorOnUIThread(ApplicationManager* manager, const GURL& url); void OnApplicationErrorOnUIThread(ApplicationManager* manager,
const GURL& url);
void ShutdownOnUIThread(); void ShutdownOnUIThread();
scoped_ptr<ApplicationLoader> loader_; scoped_ptr<ApplicationLoader> loader_;
......
...@@ -34,8 +34,8 @@ void ViewManagerLoader::Load(ApplicationManager* manager, ...@@ -34,8 +34,8 @@ void ViewManagerLoader::Load(ApplicationManager* manager,
apps_.push_back(app.release()); apps_.push_back(app.release());
} }
void ViewManagerLoader::OnServiceError(ApplicationManager* manager, void ViewManagerLoader::OnApplicationError(ApplicationManager* manager,
const GURL& url) { const GURL& url) {
} }
bool ViewManagerLoader::ConfigureIncomingConnection( bool ViewManagerLoader::ConfigureIncomingConnection(
......
...@@ -32,8 +32,8 @@ class ViewManagerLoader : public ApplicationLoader, ...@@ -32,8 +32,8 @@ class ViewManagerLoader : public ApplicationLoader,
virtual void Load(ApplicationManager* manager, virtual void Load(ApplicationManager* manager,
const GURL& url, const GURL& url,
scoped_refptr<LoadCallbacks> callbacks) OVERRIDE; scoped_refptr<LoadCallbacks> callbacks) OVERRIDE;
virtual void OnServiceError(ApplicationManager* manager, virtual void OnApplicationError(ApplicationManager* manager,
const GURL& url) OVERRIDE; const GURL& url) OVERRIDE;
// ApplicationDelegate overrides. // ApplicationDelegate overrides.
virtual bool ConfigureIncomingConnection( virtual bool ConfigureIncomingConnection(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment