Move management of browser context to BrowserContext

This commit is contained in:
Cheng Zhao 2015-09-05 20:54:36 +08:00
parent ba25bed45b
commit fafb28e41a
6 changed files with 22 additions and 38 deletions

View file

@ -6,7 +6,6 @@
#define ATOM_BROWSER_ATOM_BROWSER_MAIN_PARTS_H_
#include <list>
#include <map>
#include <string>
#include "base/callback.h"
@ -32,10 +31,6 @@ class AtomBrowserMainParts : public brightray::BrowserMainParts {
static AtomBrowserMainParts* Get();
// Returns the BrowserContext associated with the partition.
content::BrowserContext* GetBrowserContextForPartition(
const std::string& partition, bool in_memory);
// Register a callback that should be destroyed before JavaScript environment
// gets destroyed.
void RegisterDestructionCallback(const base::Closure& callback);
@ -43,10 +38,7 @@ class AtomBrowserMainParts : public brightray::BrowserMainParts {
Browser* browser() { return browser_.get(); }
protected:
// Implementations of brightray::BrowserMainParts.
brightray::BrowserContext* CreateBrowserContext() override;
// Implementations of content::BrowserMainParts.
// content::BrowserMainParts:
void PostEarlyInitialization() override;
void PreMainMessageLoopRun() override;
#if defined(OS_MACOSX)
@ -77,10 +69,6 @@ class AtomBrowserMainParts : public brightray::BrowserMainParts {
// List of callbacks should be executed before destroying JS env.
std::list<base::Closure> destruction_callbacks_;
// partition_id => browser_context
std::map<std::string, scoped_refptr<brightray::BrowserContext>>
browser_context_map_;
static AtomBrowserMainParts* self_;
DISALLOW_COPY_AND_ASSIGN(AtomBrowserMainParts);