 Chromium Code Reviews
 Chromium Code Reviews Issue 1927203003:
  Add support for X11 workspaces  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master
    
  
    Issue 1927203003:
  Add support for X11 workspaces  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master| Index: components/sessions/core/session_service_commands.cc | 
| diff --git a/components/sessions/core/session_service_commands.cc b/components/sessions/core/session_service_commands.cc | 
| index 5d3cbf4ddc3b6818b54c148e234c7aa56cb9ca68..ca02f49e881f7e068ee42901490e71e9a14fd882 100644 | 
| --- a/components/sessions/core/session_service_commands.cc | 
| +++ b/components/sessions/core/session_service_commands.cc | 
| @@ -42,6 +42,7 @@ static const SessionCommand::id_type kCommandSetTabUserAgentOverride = 18; | 
| static const SessionCommand::id_type kCommandSessionStorageAssociated = 19; | 
| static const SessionCommand::id_type kCommandSetActiveWindow = 20; | 
| static const SessionCommand::id_type kCommandLastActiveTime = 21; | 
| +static const SessionCommand::id_type kCommandSetWindowWorkspace = 22; | 
| namespace { | 
| @@ -580,6 +581,21 @@ bool CreateTabsAndWindows(const ScopedVector<SessionCommand>& data, | 
| break; | 
| } | 
| + case kCommandSetWindowWorkspace: { | 
| + std::unique_ptr<base::Pickle> pickle(command->PayloadAsPickle()); | 
| + base::PickleIterator it(*pickle); | 
| + const SessionID::id_type* window_id; | 
| + std::string workspace; | 
| + if (!it.ReadBytes(reinterpret_cast<const char**>(&window_id), | 
| + sizeof(*window_id)) || | 
| + !it.ReadString(&workspace)) { | 
| + DVLOG(1) << "Failed reading command " << command->id(); | 
| + return true; | 
| + } | 
| + GetWindow(*window_id, windows)->workspace = workspace; | 
| + break; | 
| + } | 
| + | 
| default: | 
| // TODO(skuhne): This might call back into a callback handler to extend | 
| // the command set for specific implementations. | 
| @@ -739,6 +755,18 @@ std::unique_ptr<SessionCommand> CreateLastActiveTimeCommand( | 
| return command; | 
| } | 
| +std::unique_ptr<SessionCommand> CreateSetWindowWorkspaceCommand( | 
| + const SessionID& window_id, | 
| + const std::string& workspace) { | 
| + base::Pickle pickle; | 
| + pickle.WriteBytes(static_cast<const void*>(&window_id), sizeof(window_id)); | 
| + pickle.WriteString(workspace); | 
| + std::unique_ptr<SessionCommand> command( | 
| + new SessionCommand(kCommandSetWindowWorkspace, pickle.size())); | 
| 
sky
2016/05/03 17:40:52
Use the constructor that takes a Pickle (see line
 | 
| + memcpy(command->contents(), pickle.data(), pickle.size()); | 
| + return command; | 
| +} | 
| + | 
| std::unique_ptr<SessionCommand> CreateTabNavigationPathPrunedFromBackCommand( | 
| const SessionID& tab_id, | 
| int count) { |