summaryrefslogtreecommitdiffstats
path: root/ppapi/cpp/core.cc
blob: 146a36289f608ed59644c62b0b12f52b5a517493 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ppapi/cpp/core.h"

#include "ppapi/cpp/common.h"
#include "ppapi/cpp/completion_callback.h"

namespace pp {

// This function is implemented in the .cc file to avoid including completion
// callback all over the project.
void Core::CallOnMainThread(int32_t delay_in_milliseconds,
                            const CompletionCallback& callback,
                            int32_t result) {
  return interface_->CallOnMainThread(delay_in_milliseconds,
                                      callback.pp_completion_callback(),
                                      result);
}

bool Core::IsMainThread() {
  return PPBoolToBool(interface_->IsMainThread());
}

}  // namespace pp