Load the default favicon as a native image, rather than as a Skia image.
[chromium-blink-merge.git] / mojo / embedder / platform_handle.cc
blob6cce5e8aab20c714eae1089ba25511e7e4a7bf42
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "mojo/embedder/platform_handle.h"
7 #include "build/build_config.h"
8 #if defined(OS_POSIX)
9 #include <unistd.h>
10 #elif defined(OS_WIN)
11 #include <windows.h>
12 #else
13 #error "Platform not yet supported."
14 #endif
16 #include "base/compiler_specific.h"
17 #include "base/logging.h"
19 namespace mojo {
20 namespace embedder {
22 void PlatformHandle::CloseIfNecessary() {
23 if (!is_valid())
24 return;
26 #if defined(OS_POSIX)
27 bool success = (close(fd) == 0);
28 DPCHECK(success);
29 fd = -1;
30 #elif defined(OS_WIN)
31 bool success = !!CloseHandle(handle);
32 DPCHECK(success);
33 handle = INVALID_HANDLE_VALUE;
34 #else
35 #error "Platform not yet supported."
36 #endif
39 } // namespace embedder
40 } // namespace mojo